#!/bin/bash
# train tsn-torch with one GPU
# shellcheck disable=SC1068

#ROOT_PATH=/home/shh_ucf
ROOT_PATH=/data2/hdu/shh
REPO_PATH=${ROOT_PATH}/tsn-pytorch
DATA_DIR=${ROOT_PATH}/data/data_extracted/ucf101/tvl1
TRAIN_LIST=${ROOT_PATH}/data/data_extracted/ucf101/ucf101_train_split_1_rawframes.txt
VAL_LIST=${ROOT_PATH}/data/data_extracted/ucf101/ucf101_val_split_1_rawframes.txt

WORKERS=1

MODALITY=$1
EPOCH=$2
GPU_ID=$3

if [ $# != 3 ]; then
  echo "Usage: bash run_train_torch [MODALITY] [EPOCH] [GPU_ID]"
  exit 1
fi

cd ${REPO_PATH}

echo Start ${MODALITY} training, log saved as ${MODALITY}_train_torch_${EPOCH}.log in `pwd`/${MODALITY}_train_torch_${EPOCH}.log

python main.py --dataset='ucf101' \
  --modality=${MODALITY} \
  --epochs=${EPOCH} \
  --gpus $GPU_ID \
  --batch-size=32 \
  --workers=${WORKERS} \
  --train_list=${TRAIN_LIST} \
  --val_list=${VAL_LIST} \
  --snapshot_pref='ucf101_bninception_' \
  --arch='BNInception' \
  --dropout=0.8 \
  --lr_steps 30 60 > ${MODALITY}_train_torch_${EPOCH}.log &
